home *** CD-ROM | disk | FTP | other *** search
Wrap
TTTTIIIIFFFFFFFFOOOOppppeeeennnn((((3333TTTT)))) IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll TTTTIIIIFFFFFFFFOOOOppppeeeennnn((((3333TTTT)))) NNNNAAAAMMMMEEEE TIFFOpen, TIFFFdOpen, TIFFClientOpen - open a TIFF file for reading or writing SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS ####iiiinnnncccclllluuuuddddeeee <<<<ttttiiiiffffffffiiiioooo....hhhh>>>> TTTTIIIIFFFFFFFF**** TTTTIIIIFFFFFFFFOOOOppppeeeennnn((((ccccoooonnnnsssstttt cccchhhhaaaarrrr**** ffffiiiilllleeeennnnaaaammmmeeee,,,, ccccoooonnnnsssstttt cccchhhhaaaarrrr**** mmmmooooddddeeee)))) TTTTIIIIFFFFFFFF**** TTTTIIIIFFFFFFFFFFFFddddOOOOppppeeeennnn((((ccccoooonnnnsssstttt iiiinnnntttt ffffdddd,,,, ccccoooonnnnsssstttt cccchhhhaaaarrrr**** ffffiiiilllleeeennnnaaaammmmeeee,,,, ccccoooonnnnsssstttt cccchhhhaaaarrrr**** mmmmooooddddeeee)))) ttttyyyyppppeeeeddddeeeeffff ttttssssiiiizzzzeeee____tttt ((((****TTTTIIIIFFFFFFFFRRRReeeeaaaaddddWWWWrrrriiiitttteeeePPPPrrrroooocccc))))((((tttthhhhaaaannnnddddlllleeee____tttt,,,, ttttddddaaaattttaaaa____tttt,,,, ttttssssiiiizzzzeeee____tttt))));;;; ttttyyyyppppeeeeddddeeeeffff ttttooooffffffff____tttt ((((****TTTTIIIIFFFFFFFFSSSSeeeeeeeekkkkPPPPrrrroooocccc))))((((tttthhhhaaaannnnddddlllleeee____tttt,,,, ttttooooffffffff____tttt,,,, iiiinnnntttt))));;;; ttttyyyyppppeeeeddddeeeeffff iiiinnnntttt ((((****TTTTIIIIFFFFFFFFCCCClllloooosssseeeePPPPrrrroooocccc))))((((tttthhhhaaaannnnddddlllleeee____tttt))));;;; ttttyyyyppppeeeeddddeeeeffff ttttooooffffffff____tttt ((((****TTTTIIIIFFFFFFFFSSSSiiiizzzzeeeePPPPrrrroooocccc))))((((tttthhhhaaaannnnddddlllleeee____tttt))));;;; ttttyyyyppppeeeeddddeeeeffff iiiinnnntttt ((((****TTTTIIIIFFFFFFFFMMMMaaaappppFFFFiiiilllleeeePPPPrrrroooocccc))))((((tttthhhhaaaannnnddddlllleeee____tttt,,,, ttttddddaaaattttaaaa____tttt****,,,, ttttooooffffffff____tttt****))));;;; ttttyyyyppppeeeeddddeeeeffff vvvvooooiiiidddd ((((****TTTTIIIIFFFFFFFFUUUUnnnnmmmmaaaappppFFFFiiiilllleeeePPPPrrrroooocccc))))((((tttthhhhaaaannnnddddlllleeee____tttt,,,, ttttddddaaaattttaaaa____tttt,,,, ttttooooffffffff____tttt))));;;; TTTTIIIIFFFFFFFF**** TTTTIIIIFFFFFFFFCCCClllliiiieeeennnnttttOOOOppppeeeennnn((((ccccoooonnnnsssstttt cccchhhhaaaarrrr**** ffffiiiilllleeeennnnaaaammmmeeee,,,, ccccoooonnnnsssstttt cccchhhhaaaarrrr**** mmmmooooddddeeee,,,, tttthhhhaaaannnnddddlllleeee____tttt cccclllliiiieeeennnnttttddddaaaattttaaaa,,,, TTTTIIIIFFFFFFFFRRRReeeeaaaaddddWWWWrrrriiiitttteeeePPPPrrrroooocccc rrrreeeeaaaaddddpppprrrroooocccc,,,, TTTTIIIIFFFFFFFFRRRReeeeaaaaddddWWWWrrrriiiitttteeeePPPPrrrroooocccc wwwwrrrriiiitttteeeepppprrrroooocccc,,,, TTTTIIIIFFFFFFFFSSSSeeeeeeeekkkkPPPPrrrroooocccc sssseeeeeeeekkkkpppprrrroooocccc,,,, TTTTIIIIFFFFFFFFCCCClllloooosssseeeePPPPrrrroooocccc cccclllloooosssseeeepppprrrroooocccc,,,, TTTTIIIIFFFFFFFFSSSSiiiizzzzeeeePPPPrrrroooocccc ssssiiiizzzzeeeepppprrrroooocccc,,,, TTTTIIIIFFFFFFFFMMMMaaaappppFFFFiiiilllleeeePPPPrrrroooocccc mmmmaaaapppppppprrrroooocccc,,,, TTTTIIIIFFFFFFFFUUUUnnnnmmmmaaaappppFFFFiiiilllleeeePPPPrrrroooocccc uuuunnnnmmmmaaaapppppppprrrroooocccc)))) DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN _T_I_F_F_O_p_e_n opens a TIFF file whose name is _f_i_l_e_n_a_m_e and returns a handle to be used in subsequent calls to routines in _l_i_b_t_i_f_f. If the open operation fails, then zero is returned. The _m_o_d_e parameter specifies if the file is to be opened for reading (``r''), writing (``w''), or appending (``a'') and, optionally, whether to override certain default aspects of library operation (see below). When a file is opened for appending, existing data will not be touched; instead new data will be written as additional subfiles. If an existing file is opened for writing, all previous data is overwritten. If a file is opened for reading, the first TIFF directory in the file is automatically read (also see _T_I_F_F_S_e_t_D_i_r_e_c_t_o_r_y(3T) for reading directories other than the first). If a file is opened for writing or appending, a default directory is automatically created for writing subsequent data. This directory has all the default values specified in TIFF Revision 6.0: _B_i_t_s_P_e_r_S_a_m_p_l_e=1, _T_h_r_e_s_h_H_o_l_d_i_n_g=bilevel art scan, _F_i_l_l_O_r_d_e_r=1 (most significant bit of each data byte is filled first), _O_r_i_e_n_t_a_t_i_o_n=1 (the 0th row represents the visual top of the image, and the 0th column represents the visual left hand side), _S_a_m_p_l_e_s_P_e_r_P_i_x_e_l=1, _R_o_w_s_P_e_r_S_t_r_i_p=infinity, _R_e_s_o_l_u_t_i_o_n_U_n_i_t=2 (inches), and _C_o_m_p_r_e_s_s_i_o_n=1 (no compression). To alter these values, or to define values for additional fields, _T_I_F_F_S_e_t_F_i_e_l_d(3T) must be used. _T_I_F_F_F_d_O_p_e_n is like _T_I_F_F_O_p_e_n except that it opens a TIFF file given an open file descriptor _f_d. The file's name and mode must reflect that of the open descriptor. The object associated with the file descriptor mmmmuuuusssstttt ssssuuuuppppppppoooorrrrtttt rrrraaaannnnddddoooommmm aaaacccccccceeeessssssss. PPPPaaaaggggeeee 1111 TTTTIIIIFFFFFFFFOOOOppppeeeennnn((((3333TTTT)))) IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll TTTTIIIIFFFFFFFFOOOOppppeeeennnn((((3333TTTT)))) _T_I_F_F_C_l_i_e_n_t_O_p_e_n is like _T_I_F_F_O_p_e_n except that the caller supplies a collection of functions that the library will use to do UNIX-like I/O operations. The _r_e_a_d_p_r_o_c and _w_r_i_t_e_p_r_o_c are called to read and write data at the current file position. _s_e_e_k_p_r_o_c is called to change the current file position a la _l_s_e_e_k(2). _c_l_o_s_e_p_r_o_c is invoked to release any resources associated with an open file. _s_i_z_e_p_r_o_c is invoked to obtain the size in bytes of a file. _m_a_p_p_r_o_c and _u_n_m_a_p_p_r_o_c are called to map and unmap a file's contents in memory; c.f. _m_m_a_p(2) and _m_u_n_m_a_p(2). The _c_l_i_e_n_t_d_a_t_a parameter is an opaque ``handle'' passed to the client- specified routines passed as parameters to _T_I_F_F_C_l_i_e_n_t_O_p_e_n. OOOOPPPPTTTTIIIIOOOONNNNSSSS The open mode parameter can include the following flags in addition to the ``r'', ``w'', and ``a'' flags. Note however that option flags must follow the read-write-append specification. llll When creating a new file force information be written with Little- Endian byte order (but see below). By default the library will create new files using the native CPU byte order. bbbb When creating a new file force information be written with Big- Endian byte order (but see below). By default the library will create new files using the native CPU byte order. LLLL Force image data that is read or written to be treated with bits filled from Least Significant Bit (LSB) to Most Significant Bit (MSB). Note that this is the opposite to the way the library has worked from its inception. BBBB Force image data that is read or written to be treated with bits filled from Most Significant Bit (MSB) to Least Significant Bit (LSB); this is the default. HHHH Force image data that is read or written to be treated with bits filled in the same order as the native CPU. MMMM Enable the use of memory-mapped files for images opened read-only. If the underlying system does not support memory-mapped files or if the specific image being opened cannot be memory-mapped then the library will fallback to using the normal system interface for reading information. By default the library will attempt to use memory-mapped files. mmmm Disable the use of memory-mapped files. CCCC Enable the use of ``strip chopping'' when reading images that are comprised of a single strip or tile of uncompressed data. Strip chopping is a mechanism by which the library will automatically convert the single-strip [-tile] image to multiple strips [tiles], each of which has about 8 Kilobytes of data. This facility can be useful in reducing the amount of memory used to read an image because the library normally reads each strip [tile] in its PPPPaaaaggggeeee 2222 TTTTIIIIFFFFFFFFOOOOppppeeeennnn((((3333TTTT)))) IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll TTTTIIIIFFFFFFFFOOOOppppeeeennnn((((3333TTTT)))) entirety. Strip chopping does however alter the apparent contents of the image because when an image is divided into multiple strips it looks as though the underlying file contains multiple separate strips [tiles]. Finally, note that strip chopping is an optional compile-time feature of the library; just because its use is enabled by an application does not mean that it may be present in the library. cccc Disable the use of strip chopping when reading images. BBBBYYYYTTTTEEEE OOOORRRRDDDDEEEERRRR The TIFF specification (aaaallllllll vvvveeeerrrrssssiiiioooonnnnssss) states that compliant readers _m_u_s_t _b_e _c_a_p_a_b_l_e _o_f _r_e_a_d_i_n_g _i_m_a_g_e_s _w_r_i_t_t_e_n _i_n _e_i_t_h_e_r _b_y_t_e _o_r_d_e_r. Nonetheless some software that claims to support the reading of TIFF images is incapable of reading images in anything but the native CPU byte order on which the software was written. (Especially notorious are applications written to run on Intel-based machines.) By default the library will create new files with the native byte-order of the CPU on which the application is run. This ensures optimal performance and is portable to any application that conforms to the TIFF specification. To force the library to use a specific byte-order when creating a new file the ``b'' and ``l'' option flags may be included in the call to open a file; for example, ``wb'' or ``wl''. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSS Upon successful completion _T_I_F_F_O_p_e_n, _T_I_F_F_F_d_O_p_e_n, and _T_I_F_F_C_l_i_e_n_t_O_p_e_n return a TIFF pointer. Otherwise, NULL is returned. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS All error messages are directed to the _T_I_F_F_E_r_r_o_r(3T) routine. Likewise, warning messages are directed to the _T_I_F_F_W_a_r_n_i_n_g(3T) routine. """"%%%%ssss"""":::: BBBBaaaadddd mmmmooooddddeeee. The specified _m_o_d_e parameter was not one of ``r'' (read), ``w'' (write), or ``a'' (append). %%%%ssss:::: CCCCaaaannnnnnnnooootttt ooooppppeeeennnn. _T_I_F_F_O_p_e_n() was unable to open the specified filename for read/writing. CCCCaaaannnnnnnnooootttt rrrreeeeaaaadddd TTTTIIIIFFFFFFFF hhhheeeeaaaaddddeeeerrrr. An error occurred while attempting to read the header information. EEEErrrrrrrroooorrrr wwwwrrrriiiittttiiiinnnngggg TTTTIIIIFFFFFFFF hhhheeeeaaaaddddeeeerrrr. An error occurred while writing the default header information for a new file. NNNNooootttt aaaa TTTTIIIIFFFFFFFF ffffiiiilllleeee,,,, bbbbaaaadddd mmmmaaaaggggiiiicccc nnnnuuuummmmbbbbeeeerrrr %%%%dddd ((((0000xxxx%%%%xxxx)))). The magic number in the header was not (hex) 0x4d4d or (hex) 0x4949. NNNNooootttt aaaa TTTTIIIIFFFFFFFF ffffiiiilllleeee,,,, bbbbaaaadddd vvvveeeerrrrssssiiiioooonnnn nnnnuuuummmmbbbbeeeerrrr %%%%dddd ((((0000xxxx%%%%xxxx)))). The version field in the header was not 42 (decimal). PPPPaaaaggggeeee 3333 TTTTIIIIFFFFFFFFOOOOppppeeeennnn((((3333TTTT)))) IIIImmmmaaaaggggeeee FFFFoooorrrrmmmmaaaatttt LLLLiiiibbbbrrrraaaarrrryyyy CCCC++++++++ RRRReeeeffffeeeerrrreeeennnncccceeee MMMMaaaannnnuuuuaaaallll TTTTIIIIFFFFFFFFOOOOppppeeeennnn((((3333TTTT)))) CCCCaaaannnnnnnnooootttt aaaappppppppeeeennnndddd ttttoooo ffffiiiilllleeee tttthhhhaaaatttt hhhhaaaassss ooooppppppppoooossssiiiitttteeee bbbbyyyytttteeee oooorrrrddddeeeerrrriiiinnnngggg. A file with a byte ordering opposite to the native byte ordering of the current machine was opened for appending (``a''). This is a limitation of the library. SSSSEEEEEEEE AAAALLLLSSSSOOOO _l_i_b_t_i_f_f(3T), _T_I_F_F_C_l_o_s_e(3T) PPPPaaaaggggeeee 4444